<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
    <div id="app">
        <!--  使用自定义的全局组件 -->
        <myvdiv></myvdiv>
    </div>
</body>
<script src="node_modules/vue/dist/vue.js"></script>
<script>
    /* 定义全局组件 */
    Vue.component("myvdiv",{
        template:"<h1>哈哈哈哈哈哈哈......<button v-on:click='count++;msg()'>你点了我{{count}}次</button></h1>",
        data(){
            return {
                count: 0
            }
        },
        methods:{
            msg(){
                alert();
            }
        }
    });

    // 创建vue实例
    var app = new Vue({
        el:"#app",
        data:{
            name:"",
            value:""
        },
        watch:{
            message(newVal,oldVal){

            }
        }
    });
</script>
</html>